package com.openthree.common.oss;

import com.qiniu.common.Zone;
import com.qiniu.storage.Configuration;
import com.qiniu.storage.UploadManager;
import com.qiniu.util.Auth;

import java.io.IOException;
import java.io.InputStream;

/**
 * 七牛云存储
 * @author mhj
 * @email 254784163@qq.com
 * @date 2017-03-25 15:41
 */
public class QiniuCloudStorageService extends CloudStorageService{
    private UploadManager uploadManager;
    private String token;

    public QiniuCloudStorageService(CloudStorageConfig config){
        this.config = config;

        //初始化
        init();
    }

    private void init(){
        uploadManager = new UploadManager(new Configuration(Zone.autoZone()));
        token = Auth.create(config.getQiniuAccessKey(), config.getQiniuSecretKey()).
                uploadToken(config.getQiniuBucketName());
    }


    @Override
    public String getPath(String prefix) {
        return super.getPath(prefix);
    }

    @Override
    public String uploadObjectByInputStream(InputStream inputStream, String folder, String fileName) {
        return null;
    }

    @Override
    public String uploadObjectByInputStream(InputStream inputStream, String fileFullPath) {
        return null;
    }

    @Override
    public byte[] getFileByteByKey(String fileKey) {
        return new byte[0];
    }

    @Override
    public InputStream getFileInputStreamByKey(String key) {
        return null;
    }

    @Override
    public String getFileUrl(String ossFileKey, int expires) {
        return null;
    }

    @Override
    public String getSltFileUrl(String ossFileKey, String centerName) throws IOException {
        return null;
    }

    @Override
    public byte[] toByteArray(InputStream input) throws Exception {
        return super.toByteArray(input);
    }
}
